import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
import { NzInputModule } from 'ng-zorro-antd/input';

@Component({
  selector: 'app-auto-complete-basic-demo',
  standalone: true,
  imports: [NzAutocompleteModule, FormsModule, NzInputModule],
  templateUrl: './auto-complete-basic-demo.component.html',
  styleUrl: './auto-complete-basic-demo.component.less',
})
export class AutoCompleteBasicDemoComponent {
  value = '';
  options: string[] = [];
  OnInputChange(evt: Event) {
    const value = (evt.target as HTMLInputElement).value;
    if (value) {
      this.options = [value, value + value, value + value + value];
    } else {
      this.options = [];
    }
  }
}
